<script type="text/javascript">
	function showProgress() {
		window.scrollTo(0,0);
		document.getElementById('progress').style.display = 'block';
		document.getElementById('content').style.display = 'none';
	}
</script>
<div id="content">
	<h3><?php _e( 'Nuke WP e-Commerce', 'wpsc_st' ); ?></h3>
	<p><?php _e( 'Select the WP e-Commerce tables you wish to empty then click Remove to permanently remove WP e-Commerce generated details from your WordPress database.', 'wpsc_st' ); ?></p>
	<form method="post" onsubmit="showProgress()">
		<div id="poststuff">

			<div class="postbox">
				<h3 class="hndle"><?php _e( 'Empty WP e-Commerce Tables', 'wpsc_st' ); ?></h3>
				<div class="inside">
					<p class="description"><?php _e( 'Permanently remove WP e-Commerce details.', 'wpsc_st' ); ?></p>
					<table class="form-table">

						<tr>
							<th>
								<label for="products"><?php _e( 'Products', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="products" name="wpsc_st_products"<?php if( $products == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $products; ?>)
							</td>
						</tr>

						<tr>
							<th>
								<label for="product_variations"><?php _e( 'Product Variations', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="product_variations" name="wpsc_st_product_variations"<?php if( $variations == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $variations; ?>)
							</td>
						</tr>

						<tr>
							<th>
								<label for="product_images"><?php _e( 'Product Images', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="product_images" name="wpsc_st_product_images"<?php if( $images == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $images; ?>)
							</td>
						</tr>

						<tr>
							<th>
								<label for="product_files"><?php _e( 'Product Files', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="product_files" name="wpsc_st_product_files"<?php if( $files == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $files; ?>)
							</td>
						</tr>

						<tr>
							<th>
								<label for="product_tags"><?php _e( 'Product Tags', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="product_tags" name="wpsc_st_product_tags"<?php if( $tags == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $tags; ?>)
							</td>
						</tr>

						<tr>
							<th>
								<label for="product_categories"><?php _e( 'Product Categories', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="product_categories" name="wpsc_st_product_categories"<?php if( $categories == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $categories; ?>)
							</td>
						</tr>

						<tr>
							<th>
								<label for="sales_orders"><?php _e( 'Sales', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="sales_orders" name="wpsc_st_sales_orders"<?php if( $orders == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $orders; ?>)
							</td>
						</tr>

						<tr>
							<th>
								<label for="coupons"><?php _e( 'Coupons', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="coupons" name="wpsc_st_coupons"<?php if( $coupons == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $coupons; ?>)
							</td>
						</tr>

					</table>
				</div>
			</div>
			<!-- .postbox -->

			<div class="postbox">
				<h3 class="hndle"><?php _e( '3rd Party Plugins', 'wpsc_st' ); ?></h3>
				<div class="inside">
					<p class="description"><?php _e( 'Permanently remove details created by other WP e-Commerce Plugins.', 'wpsc_st' ); ?></p>
					<table class="form-table">

<?php if( $wishlist ) { ?>
						<tr>
							<th>
								<label for="wishlist"><?php _e( 'Wishlist', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="wishlist" name="wpsc_st_wishlist"<?php if( $wishlist == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $wishlist; ?>)
								<span class="description"><?php _e( 'via Add to Wishlist', 'wpsc_st' ); ?></span>
							</td>
						</tr>

<?php } ?>
<?php if( $enquiries ) { ?>
						<tr>
							<th>
								<label for="enquiries"><?php _e( 'Enquiries', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="enquiries" name="wpsc_st_enquiries"<?php if( $enquiries == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $enquiries; ?>)
								<span class="description"><?php _e( 'via Product Enquiry', 'wpsc_st' ); ?></span>
							</td>
						</tr>

<?php } ?>
<?php if( $credit_cards ) { ?>
						<tr>
							<th>
								<label for="creditcards"><?php _e( 'Credit Cards', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="creditcards" name="wpsc_st_creditcards"<?php if( $credit_cards == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $credit_cards; ?>)
								<span class="description"><?php _e( 'via Offline Credit Card Processing', 'wpsc_st' ); ?></span>
							</td>
						</tr>

<?php } ?>
<?php if( $attributes ) { ?>
						<tr>
							<th>
								<label for="customfields"><?php _e( 'Attributes', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="customfields" name="wpsc_st_customfields"<?php if( $attributes == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $attributes; ?>)
								<span class="description"><?php _e( 'via Custom Fields', 'wpsc_st' ); ?></span>
							</td>
						</tr>

<?php } ?>
					</table>
				</div>
			</div>

			<div class="postbox">
				<h3 class="hndle"><?php _e( 'Empty WordPress Tables', 'wpsc_st' ); ?></h3>
				<div class="inside">
					<p class="description"><?php _e( 'Permanently remove WordPress details.', 'wpsc_st' ); ?></p>
					<table class="form-table">

						<tr>
							<th>
								<label for="posts"><?php _e( 'Posts', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="posts" name="wpsc_st_posts"<?php if( $posts == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $posts; ?>)
							</td>
						</tr>

						<tr>
							<th>
								<label for="post_categories"><?php _e( 'Post Categories', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="post_categories" name="wpsc_st_post_categories"<?php if( $post_categories == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $post_categories; ?>)
							</td>
						</tr>

						<tr>
							<th>
								<label for="post_tags"><?php _e( 'Post Tags', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="post_tags" name="wpsc_st_post_tags"<?php if( $post_tags == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $post_tags; ?>)
							</td>
						</tr>

						<tr>
							<th>
								<label for="links"><?php _e( 'Links', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="links" name="wpsc_st_links"<?php if( $links == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $links; ?>)
							</td>
						</tr>

						<tr>
							<th>
								<label for="comments"><?php _e( 'Comments', 'wpsc_st' ); ?></label>
							</th>
							<td>
								<input type="checkbox" id="links" name="wpsc_st_comments"<?php if( $comments == 0 ) { ?> disabled="disabled"<?php } ?> /> (<?php echo $comments; ?>)
							</td>
						</tr>

					</table>
				</div>
			</div>
			<!-- .postbox -->

		</div>
		<p class="submit">
			<input type="submit" value="<?php _e( 'Remove', 'wpsc_st' ); ?>" class="button-primary" />
		</p>
		<input type="hidden" name="action" value="nuke" />
	</form>

	<h3><?php _e( 'WP e-Commerce Tools', 'wpsc_st' ); ?></h3>
	<form method="post">
		<div id="poststuff">
			<div class="postbox">
				<h3 class="hndle"><?php _e( 'Tools', 'wpsc_st' ); ?></h3>
				<div class="inside">
					<table class="form-table">
						<tr>
							<td>
								<a href="admin.php?page=wpsc_st&action=relink-pages"><?php _e( 'Re-link WP e-Commerce Pages', 'wpsc_st' ); ?></a>
								<p class="description"><?php _e( 'This tool will re-link the default WP e-Commerce Pages where customers are encountering dead shop links (e.g. Products Page, Checkout, Transaction Results, etc.)', 'wpsc_st' ); ?></p>
							</td>
						</tr>
						<tr>
							<td>
								<a href="admin.php?page=wpsc_st&action=relink-existing-preregistered-sales"><?php _e( 'Re-link existing Sales from pre-registered Users', 'wpsc_st' ); ?></a>
								<p class="description"><?php _e( 'This tool will attempt to re-link Sales with no User linked to existing Users, this is common where a customer makes a purchase then later registers for the site. Using this tool their Sale will appear within My Account.', 'wpsc_st' ); ?></p>
							</td>
						</tr>
						<tr>
							<td>
								<a href="admin.php?page=wpsc_st&action=fix-wpsc_version"><?php _e( 'Repair WordPress option \'wpsc_version\'', 'wpsc_st' ); ?></a>
								<p class="description"><?php _e( 'If you have upgraded to WP e-Commerce 3.8 then rolled back to 3.7 this will fix common store issues.', 'wpsc_st' ); ?></p>
							</td>
						</tr>
						<tr>
							<td>
								<a href="admin.php?page=wpsc_st&action=clear-claimed_stock"><?php _e( 'Empty the \'claimed_stock\' table', 'wpsc_st' ); ?></a>
								<p class="description"><?php _e( 'This tool will dump all pending stock that has not been purchased for (e.g. abandoned carts).', 'wpsc_st' ); ?></p>
							</td>
						</tr>
						<tr>
							<td>
								<label><input type="checkbox" id="demo_store" name="wpsc_st_demo_store"<?php checked( $demo_store, 'on' ); ?>/> <?php _e( 'Demo Store', 'wpsc_st' ); ?></label>
								<p class="description"><?php _e( 'Show a banner at the top of every page stating this shop is currently in testing mode.', 'wpsc_st' ); ?></p>
							</td>
						</tr>
						<tr>
							<td>
								<label for="demo_store_text"><?php _e( 'Demo Store Message', 'wpsc_st' ); ?></label><br />
								<input type="text" id="demo_store_text" name="wpsc_st_demo_store_text" value="<?php echo $demo_store_text; ?>" size="80" />
								<p class="description"><?php _e( 'Customise the message that appears at the top of every page', 'wpsc_st' ); ?></p>
							</td>
						</tr>
					</table>
				</div>
			</div>
		</div>
		<input type="submit" value="<?php _e( 'Save Changes', 'wpsc_st' ); ?>" class="button-primary" />
		<input type="hidden" name="action" value="tools" />
	</form>

</div>
<div id="progress" style="display:none;">
	<p><?php _e( 'Chosen WP e-Commerce details are being nuked, this process can take awhile. Time for a beer?', 'wpsc_st' ); ?></p>
	<img src="<?php echo plugins_url( '/templates/admin/images/progress.gif', $wpsc_st['relpath'] ); ?>" alt="" />
</div>